import { Component, OnInit } from '@angular/core';
import {ActivatedRoute} from '@angular/router';
@Component({
  selector: 'app-newsdetail',
  templateUrl: './newsdetail.component.html',
  styleUrls: ['./newsdetail.component.less']
})
export class NewsdetailComponent implements OnInit {

  constructor( public route:ActivatedRoute) { }

  ngOnInit(): void {

    //获取参数
    // console.log(this.route.queryParams.value)
    // this.route.queryParams.value  //错误

    this.route.queryParams.subscribe((data)=>{
      console.log(data)
    })

  }

}
